﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace PSUA_RideSharing
{
    public partial class Site1 : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["username"] != null)
            {
                lblLogInResult.Text = "Welcome " + Session["username"].ToString();
                LogOutPanel.Visible = true;
                A5.Visible = true;
                A6.Visible = true;
            }
            else if (Session["loggedout"] != null)
            {
                lblLogInResult.Text = Session["loggedout"].ToString();
            }
        }

        protected void Unnamed1_Click(object sender, EventArgs e)
        {
            Session.Remove("username");
            Session["loggedout"] = "You have been logged out.";
            LogOutPanel.Visible = false;
            A5.Visible = false;
            A6.Visible = false;
            Response.Redirect("~/");
        }

       
    }
}